package com.dingding.special.order.bill.sql;

public class QueryWaterBillSql {

	/** 
	 * @ClassName: QueryWaterBillSql 
	 * @Description: 查询账单流水sql
	 * @author SUNZHICHENG 
	 * @date 2016年8月23日 上午9:43:09 
	 * @version v2.4.0
	 * 
	*/
		// 查询总流水和订单总数
		public  static final String QUERY_WATER_BILL = " SELECT grabOrderUserId grabOrderUserId, totalMoney totalTurnover, orderStatus orderStatus FROM SpecialUserLogin sul,UserSpecialOrder uso WHERE uso.grabOrderUserId = sul.suid AND uso.grabOrderUserId = ? AND date_format(uso.createTime,'%Y-%m-%d') BETWEEN ? and ? ";
		
		/**
		 * 查询总流水和订单总数(出租车)
		 * @author YHQ
		 * @since V2.5.6
		 */
		public  static final String QUERY_TAXI_WATER_BILL = " SELECT grabOrderUserId grabOrderUserId, totalMoney totalTurnover, orderStatus orderStatus FROM SpecialUserLogin sul,Userorder uso WHERE uso.grabOrderUserId = sul.suid AND uso.grabOrderUserId = ? AND date_format(uso.createTime,'%Y-%m-%d') BETWEEN ? and ? ";
		
		//查询日期内每天订单完成数详情
		public  static final String QUERY_ORDER_PARTICULARS=" select uso.orderStatus orderStatus,date_format(uso.createTime, '%Y-%m-%d') dateTime FROM SpecialUserLogin sul,UserSpecialOrder uso WHERE	uso.grabOrderUserId = sul.suid AND uso.grabOrderUserId = ? AND date_format(uso.createTime, '%Y-%m-%d') BETWEEN ? AND ? ORDER BY uso.createTime DESC ";
		
		/**
		 * 查询日期内每天订单完成数详情(出租车)
		 * @author YHQ
		 * @since V2.5.6
		 */
		public  static final String QUERY_TAXI_ORDER_PARTICULARS=" select uso.orderStatus orderStatus,date_format(uso.createTime, '%Y-%m-%d') dateTime FROM SpecialUserLogin sul,userorder uso WHERE	uso.grabOrderUserId = sul.suid AND uso.grabOrderUserId = ? AND date_format(uso.createTime, '%Y-%m-%d') BETWEEN ? AND ? ORDER BY uso.createTime DESC ";

		//查询日期内每天订单流水
		public  static final String QUERY_ORDER_WATER=" select uso.totalMoney totalTurnover,uso.orderStatus orderStatus,date_format(uso.createTime, '%Y-%m-%d') dateTime  FROM SpecialUserLogin sul,	UserSpecialOrder uso WHERE uso.grabOrderUserId = sul.suid AND uso.grabOrderUserId = ? AND date_format(uso.createTime, '%Y-%m-%d') BETWEEN ? AND ? ORDER BY uso.createTime DESC ";
		
		/**
		 * 查询日期内每天出租车订单流水
		 * @author YHQ
		 * @since V2.5.6
		 * @modify hufan 查询userorder而不是UserSpecialOrder
		 */
		public  static final String QUERY_TAXI_ORDER_WATER=" select uso.totalMoney totalTurnover,uso.orderStatus orderStatus,date_format(uso.createTime, '%Y-%m-%d') dateTime  FROM SpecialUserLogin sul,userorder uso WHERE uso.grabOrderUserId = sul.suid AND uso.grabOrderUserId = ? AND date_format(uso.createTime, '%Y-%m-%d') BETWEEN ? AND ? ORDER BY uso.createTime DESC ";
	
		//查询日期内每天的订单完成率
		//
		public static final String QUERY_ORDER_FINISHRATE=" select uso.orderStatus orderStatus,	date_format(uso.createTime, '%Y-%m-%d') dateTime FROM SpecialUserLogin sul,	userspecialorder uso WHERE	uso.grabOrderUserId = sul.suid AND uso.grabOrderUserId = ? AND date_format(uso.createTime, '%Y-%m-%d') BETWEEN ? AND ? ORDER BY uso.createTime DESC ";
		
		/**
		 * 查询日期内每天的订单完成率(出租车)
		 * @author YHQ
		 * @since V2.5.6
		 */
		public static final String QUERY_TAXI_ORDER_FINISHRATE=" select uso.orderStatus orderStatus,	date_format(uso.createTime, '%Y-%m-%d') dateTime FROM SpecialUserLogin sul,	userorder uso WHERE	uso.grabOrderUserId = sul.suid AND uso.grabOrderUserId = ? AND date_format(uso.createTime, '%Y-%m-%d') BETWEEN ? AND ? ORDER BY uso.createTime DESC ";
}
